package plugin.bpce.actions;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;

import plugin.bpce.Object.InterfaceCoppeer;
import plugin.bpce.Telas.TelaConfiguracao;
import plugin.bpce.modelo.ConfiguracaoModelo;

public class Configuracao implements IWorkbenchWindowActionDelegate {
	private IWorkbenchWindow window;	
	private TelaConfiguracao Tela;
	
	public void dispose() {
		// TODO Auto-generated method stub
	}

	public void init(IWorkbenchWindow window) {
		this.window = window;
	}

	public void run(IAction action) {
		String porta;
		InterfaceCoppeer util;
		ConfiguracaoModelo configuracao;
		
		util = new InterfaceCoppeer();
		
		porta = util.verificaPortaCOPPEER();
		configuracao = util.recuperaConfiguracao(porta);
		
		Tela = new TelaConfiguracao(window.getShell(), configuracao, porta); 					
		Tela.setBlockOnOpen(true);			
		Tela.open();
	}
	
	public void selectionChanged(IAction action, ISelection selection) {
		// TODO Auto-generated method stub

	}

}
